﻿/**
 *    Copyright 2006 - 2011 Opera Software ASA
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 *
 **/


/* load after build_application.jsn */

window.app.builders.ConsoleLogger || ( window.app.builders.ConsoleLogger = {} );
/**
  * @param {Object} service the service description of the according service on the host side
  */
window.app.builders.ConsoleLogger["2.0"] = function(service)
{
  var namespace = cls.ConsoleLogger && cls.ConsoleLogger["2.0"];
  if(namespace)
  {
    window.error_console_data = new namespace.ErrorConsoleData();
  }
  var view_namespace = cls.ConsoleLogger;
  if(view_namespace)
  {
    new view_namespace.ConsoleView("console", ui_strings.M_VIEW_LABEL_CONSOLE, "scroll");
    view_namespace.ConsoleView.create_ui_widgets();
    // TODO proper namespace handling for views
    ErrorConsoleView.roughViews.createViews();
    return true;
  }
};

window.app.builders.ConsoleLogger["2.1"] = function(service)
{
  var namespace = cls.ConsoleLogger && cls.ConsoleLogger["2.1"];
  if(namespace)
  {
    window.error_console_data = new namespace.ErrorConsoleData();
  }
  var view_namespace = cls.ConsoleLogger;
  if(view_namespace)
  {
    new view_namespace.ConsoleView("console", ui_strings.M_VIEW_LABEL_CONSOLE, "scroll");
    view_namespace.ConsoleView.create_ui_widgets();
    ErrorConsoleView.roughViews.createViews();
    return true;
  }
};
